#pragma once

#include "../VulkanRHI.h"
#include "../Texture/RHITexture.h"
#include "../Texture/RHISampler.h"

class SwapChain;

class ImguiGUI
{
	struct UboUI {
		glm::vec2 scale;
		glm::vec2 translate;
	};

public:

	ImguiGUI(SwapChain* swapChain);

	void Init();

	void Exit();

	void Update();

	void UpdateCommand();
	
protected:

	void CreateContext();

	void CreateResource();

	void CreateDescriptor();

	void CreatePipeline();

protected:

	void UpdateInput();

	void UpdateWidget();

	void UpdateBuffer();

protected:

	SwapChain* mSwapChain;

	RefCountPtr<RHITexture> mFontTexture;

	RefCountPtr<RHISampler> mFontSampler;

	RefCountPtr<RHIBuffer> mVertexBuffer;

	RefCountPtr<RHIBuffer> mIndexBuffer;

	VkDescriptorSetLayout mDescriptorSetLayout;

	VkPipelineLayout mPipelineLayout;

	VkDescriptorPool mDescriptorPool;

	std::vector<VkDescriptorSet> mDescriptorSets;

	VkPipeline mPipeline;

	VkPipelineCache mPipelineCache;

	UboUI mPushConstBlock;

	uint32 mLastVtxCount;

	uint32 mLastIdxCount;
};